package nl.haemers.data.reflection 
{
	import nl.haemers.data.collections.List;
	import nl.haemers.data.reflection.IAccessor;
	import nl.haemers.data.constants.ReflectionConstants;
	/**
	 * ...
	 * @author Jonathan Haemers
	 */
	public class Accessors extends List implements IAccessors 
	{
		
		public function Accessors() 
		{
		}
		
		/** Public methods **/
		public function getAccessor(name:String) : IAccessor 
		{
			return super.search(name) as IAccessor;
		}
		
		public function hasAccessor(name:String) : Boolean
		{
			return super.hasKey(name);
		}
		
		internal static function init(xml:XML) : IAccessors
		{
			var accessors:Accessors = new Accessors();
			
			for each(var node:XML in xml.elements(ReflectionConstants.XML_ACCESSOR))
			{
				var accessor:Accessor = Accessor.init(node) as Accessor;
				accessors.add(accessor.toString(), accessor);
			}
			
			return accessors;
		}
		/** Getters & Setters **/
		
		/** Protected methods **/
		
		/** Private methods **/
		
	}

}